CC=g++
LD=g++
BIN = image
SRCS=$(wildcard *.c)
SRCS+=$(wildcard m_total_expension/*.c)
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)
CFLAGS = -W -Wall -ansi -pedantic -I /usr/include/opencv
LDFLAGS= -lcv -lhighgui

all: $(BIN)
$(BIN): $(OBJS)
	$(LD) -o $@ $(OBJS) $(LDFLAGS)

%.o: %.c
	$(CC) -o $@ -c $< $(CFLAGS)

%.d: %.c
	$(CC) $(CFLAGS) -MM -MD -o $@ $<

-include $(DEPS)

.PHONY: clean distclean

clean:
	rm -rf $(OBJS)

distclean: clean
	rm -rf $(BIN)
